package com.lwq.designpattern.structuralPatterns.flyweightPattern;

/**
 * @author liwq
 * @description
 * @date 2021/11/29 14:38
 */
public class FiveInARowChess implements Chess {
    // 颜色：黑或者白
    private String color;
    // 坐标
    private int x;
    private int y;

    public FiveInARowChess(String color) {
        this.color = color;
    }

    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }

    @Override
    public void play() {
        System.out.println("本次操作：" + toString());
    }

    @Override
    public String toString() {
        return "FiveInARowChess{" + "color='" + color + '\'' + ", x=" + x + ", y=" + y + '}';
    }
}
